// -*- coding: utf-8 -*- 
/**
 * Project: AlgorithmsLearn
 *
 * @author: yanking
 * Create time: 2022-03-25 19:48
 * IDE: IntelliJ IDEA
 * Introduction:
 */
package com.LeetCodeT.DateTrain;

import org.junit.jupiter.api.Test;

public class TrailingZeroes {
    /**
     * 阶乘后的连续0个数
     */
    public int trailingZeroes(int n) {
        // 硬算
        int ans = 1, res = 0;
        while (n > 0) {
            ans *= (n--);
        }
        System.out.println(ans);
        while (ans > 0) {
            if (ans % 10 == 0) {
                res++;
            }
            ans /= 10;
        }
        return res;
    }


    @Test
    public void shout() {
        int n = 21;
        System.out.println(trailingZeroes(n));
    }
}
